import { Pipe, PipeTransform } from '@angular/core';
import { ConstantService } from '../../core';

@Pipe({
    name: 'mapping'
})
export class MappingPipe implements PipeTransform {

    constructor(private constantService: ConstantService) { }

    transform(value: any, args: string): string {
        const key = args + 'Mapping';
        return (this.constantService[key]
            && this.constantService[key][value])
            || '未知';
    }

}
